class Solution {
public:
    double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) {
        int i=0;
        int j=0;
        int z=0;
        int size1=nums1.size();
        int size2=nums2.size();
        int arr[size1+size2];
       
            while (i<size1&&j<size2){
                if (nums1[i]<nums2[j]){
                    arr[z]=nums1[i];
                     i++;
                }
                else{
                     arr[z]=nums2[j];
                     j++;
                }
                z++;
             
              
            }
            while(i<size1){ 
                arr[z++]=nums1[i++];
                
            }
                while(j<size2){ 
                arr[z++]=nums2[j++];
                
            }
            
        if ((size1+size2)%2==1)
        return arr[(size1+size2)/2];
                 
        if ((size1+size2)%2==0)
        return (arr[(size1+size2-1)/2]+arr[(size1+size2)/2])/2.0;
    }
};